package cz.cvut.fel.gfupan.gui.util;

public class AutoCompleteItem {

    public final String name;
    public final int measure;
    public final int tab;
    public final int id;

    public AutoCompleteItem(String name) {
        this(0, 0, 0, name);
    }

    public AutoCompleteItem(int measure, int tab, int id, String name) {
        this.name = name;
        this.measure = measure;
        this.tab = tab;
        this.id = id;
    }

    @Override
    public boolean equals(Object x) {
        if (x == null) {
            return false;
        }
        if (!(x instanceof AutoCompleteItem)) {
            return false;
        }

        AutoCompleteItem xx = (AutoCompleteItem) x;
        return this.name.equals(xx.name);
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 43 * hash + (this.name != null ? this.name.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return name;
    }
}
